import Vue from 'vue'
import Router from 'vue-router';
Vue.use(Router)

/*---------------------------------引入页面----------------------------------------------- */
/*------------------首页-------------------- */
const Index = r => require.ensure([], () => r(require('@/pages/Index/Index')), 'Index');
/* ------------------------------ 配置 -------------------------------------- */
//banner配置
const BannerConfig = r => require.ensure([], () => r(require('@/pages/Config/BannerConfig')), 'BannerConfig');


/* ------------------------------ 用户管理 -------------------------------------- */
//用户列表
const UserList = r => require.ensure([], () => r(require('@/pages/User/UserList')), 'UserList');
//1.0用户列表
const OldUserList = r => require.ensure([], () => r(require('@/pages/User/OldUserList')), 'OldUserList');
//用户详情
const UserDetails = r => require.ensure([], () => r(require('@/pages/User/UserDetails')), 'UserDetails');
//用户关系
const Relation = r => require.ensure([], () => r(require('@/pages/User/Relation')), 'Relation');
//合伙人列表
const PartnerList = r => require.ensure([], () => r(require('@/pages/User/PartnerList')), 'PartnerList');
//省代列表
const ProvinceList = r => require.ensure([], () => r(require('@/pages/User/ProvinceList')), 'ProvinceList');
//市代列表
const CityList = r => require.ensure([], () => r(require('@/pages/User/CityList')), 'CityList');
//区代列表
const TownList = r => require.ensure([], () => r(require('@/pages/User/TownList')), 'TownList');
//个人代理列表
const PersonalList = r => require.ensure([], () => r(require('@/pages/User/PersonalList')), 'PersonalList');
//推广员列表
const PromotersList = r => require.ensure([], () => r(require('@/pages/User/PromotersList')), 'PromotersList')


/* ------------------------------ 服务管理 -------------------------------------- */
//服务列表
const ServiceList = r => require.ensure([], () => r(require('@/pages/Service/ServiceList')), 'ServiceList');


/* ------------------------------ 视频管理 -------------------------------------- */
//视频列表
const VideoList = r => require.ensure([], () => r(require('@/pages/Video/VideoList')), 'VideoList');
//视频审核
const VideoAudit = r => require.ensure([], () => r(require('@/pages/Video/VideoAudit')), 'VideoAudit');
//视频播放
const VideoPlay = r => require.ensure([], () => r(require('@/pages/Video/VideoPlay')), 'VideoPlay');


/* ------------------------------ 共享信息管理 -------------------------------------- */
//信息列表
const ShareInfoList = r => require.ensure([], () => r(require('@/pages/ShareInfo/ShareInfoList')), 'ShareInfoList');
//审核列表
const ShareInfoAudit = r => require.ensure([], () => r(require('@/pages/ShareInfo/ShareInfoAudit')), 'ShareInfoAudit');



/* ------------------------------ 订单管理 -------------------------------------- */
//订单列表
const OrderList = r => require.ensure([], () => r(require('@/pages/Order/OrderList')), 'OrderList');


/* ------------------------------ 财务管理 -------------------------------------- */
//提现记录
const Withdrawal = r => require.ensure([], () => r(require('@/pages/Financial/Withdrawal')), 'Withdrawal');
//提现审核
const WithdrawalAudit = r => require.ensure([], () => r(require('@/pages/Financial/WithdrawalAudit')), 'WithdrawalAudit');
//充值记录
const TopUp = r => require.ensure([], () => r(require('@/pages/Financial/TopUp')), 'TopUp');


/* ------------------------------ 代理管理 -------------------------------------- */
//---------合伙人---------
//合伙人界面总览
const Partner = r => require.ensure([], () => r(require('@/pages/Agent/Partner/Partner')), 'Partner');
//收益总览
const PartnerEarnings = r => require.ensure([], () => r(require('@/pages/Agent/Partner/Earnings')), 'PartnerEarnings');
//提现记录
const PartnerWithdrawal = r => require.ensure([], () => r(require('@/pages/Agent/Partner/WithdrawalAgent')), 'PartnerWithdrawal');
//--------区域代理--------
//区域代理总览
const Area = r => require.ensure([], () => r(require('@/pages/Agent/Area/Area')), 'Area');
//收益总览
const AreaEarnings = r => require.ensure([], () => r(require('@/pages/Agent/Area/Earnings')), 'AreaEarnings');
//提现记录
const AreaWithdrawal = r => require.ensure([], () => r(require('@/pages/Agent/Area/WithdrawalAgent')), 'AreaWithdrawal');
//邀请人
const AreaInvite = r => require.ensure([], () => r(require('@/pages/Agent/Area/Invite')), 'AreaInvite');
//--------全国代理---------
//全国代理总览
const National = r => require.ensure([], () => r(require('@/pages/Agent/National/National')), 'National');
//收益总览
const NationalEarnings = r => require.ensure([], () => r(require('@/pages/Agent/National/Earnings')), 'NationalEarnings');
//推广人
const NationalInvite = r => require.ensure([], () => r(require('@/pages/Agent/National/Invite')), 'NationalInvite');
//-------个人代理----------
//个人代理总览
const Personal = r => require.ensure([], () => r(require('@/pages/Agent/Personal/Personal')), 'Personal');
//个人代理收益总览
const PersonalEarnings = r => require.ensure([], () => r(require('@/pages/Agent/Personal/Earnings')), 'PersonalEarnings');
//个人代理推广人
const PersonalInvite = r => require.ensure([], () => r(require('@/pages/Agent/Personal/Invite')), 'PersonalInvite');

/* ------------------------------ 系统管理 -------------------------------------- */
const VouchersList = r => require.ensure([], () => r(require('@/pages/Vouchers/VouchersList')), 'VouchersList');


/* ------------------------------ 系统管理 -------------------------------------- */
//---------区域代理--------
//权限管理
const Permissions = r => require.ensure([], () => r(require('@/pages/System/Area/Permissions')), 'Permissions');
//代理管理
const AreaAgentConfig = r => require.ensure([], () => r(require('@/pages/System/Area/AgentConfig')), 'AgentConfig');
//---------全国代理--------
//代理管理
const NationalAgentConfig = r => require.ensure([], () => r(require('@/pages/System/National/AgentConfig')), 'AgentConfig');
//---------系统管理--------
//人员管理
const PersonnelManagement = r => require.ensure([], () => r(require('@/pages/System/System/PersonnelManagement')), 'PersonnelManagement');
//添加成员
const AddUser = r => require.ensure([], () => r(require('@/pages/System/System/AddUser')), 'AddUser');
//用户录入
const DataEntry = r => require.ensure([], () => r(require('@/pages/System/System/DataEntry')), 'DataEntry');
//角色管理
const Role = r => require.ensure([], () => r(require('@/pages/System/System/Role')), 'Role');
//权限管理
const PermissionLsit = r => require.ensure([], () => r(require('@/pages/System/System/PermissionList')), 'PermissionLsit');
//反馈管理
const FeedBack = r => require.ensure([], () => r(require('@/pages/System/System/FeedBack')), 'FeedBack');

/* ------------------------------ 系统设置 -------------------------------------- */
//banner管理
const Banner = r => require.ensure([], () => r(require('@/pages/Config/BannerConfig')), 'Banner');
//地区管理
const AreaConfig = r => require.ensure([], () => r(require('@/pages/Config/AreaConfig')), 'AreaConfig');
//账户设置
const AccountConfig = r => require.ensure([], () => r(require('@/pages/Config/AccountConfig')), 'AccountConfig');
//平台设置
const Platform = r => require.ensure([], () => r(require('@/pages/Config/Platform')), 'Platform');
//系统通知管理
const Notice = r => require.ensure([], () => r(require('@/pages/Config/Notice')), 'Notice');
//公司简介
const CompanyProfile = r => require.ensure([], () => r(require('@/pages/Config/CompanyProfile')), 'CompanyProfile');
//安卓包管理
const Apk = r => require.ensure([], () => r(require('@/pages/Config/Apk')), 'Apk');

const routes = [
    {
        path: '/index',
        name: 'Index',
        component: Index,
        meta:{
            menu:['首页']
        }
    }, {
        path: '/bannerconfig',
        name: 'BannerConfig',
        component: BannerConfig,
        meta:{
            menu:['配置管理','banner配置']
        }
    }, {
        path: '/user/userlist',
        name: 'UserList',
        component: UserList,
        meta:{
            menu:['用户管理','用户列表']
        }
    }, {
        path: '/user/olduserlist',
        name: 'OldUserList',
        component: OldUserList,
        meta:{
            menu:['用户管理','1.0用户列表']
        }
    }, {
        path: '/user/userdetails',
        name: 'UserDetails',
        component: UserDetails,
        meta:{
            menu:['用户管理','用户详情']
        }
    }, {
        path: '/user/relation',
        name: 'Relation',
        component: Relation,
        meta:{
            menu:['用户管理','用户关系']
        }
    }, {
        path: '/user/partnerlist',
        name: 'PartnerList',
        component: PartnerList,
        meta:{
            menu:['用户管理','合伙人列表']
        }
    }, {
        path: '/user/provincelist',
        name: 'ProvinceList',
        component: ProvinceList,
        meta:{
            menu:['用户管理','省代列表']
        }
    }, {
        path: '/user/citylist',
        name: 'CityList',
        component: CityList,
        meta:{
            menu:['用户管理','市代列表']
        }
    }, {
        path: '/user/townlist',
        name: 'TownList',
        component: TownList,
        meta:{
            menu:['用户管理','区代列表']
        }
    }, {
        path: '/user/personallist',
        name: 'PersonalList',
        component: PersonalList,
        meta:{
            menu:['用户管理','个人代理列表']
        }
    }, {
        path: '/user/PromotersList',
        name: 'PromotersList',
        component: PromotersList,
        meta:{
            menu:['用户管理','推广员列表']
        }
    }, {
        path: '/service/servicelist',
        name: 'ServiceList',
        component: ServiceList,
        meta:{
            menu:['服务管理','服务列表']
        }
    }, {
        path: '/video/videolist',
        name: 'VideoList',
        component: VideoList,
        meta:{
            menu:['视频管理','视频列表']
        }
    }, {
        path: '/video/videoaudit',
        name: 'VideoAudit',
        component: VideoAudit,
        meta:{
            menu:['视频管理','视频审核']
        }
    }, {
        path: '/video/videoplay',
        name: 'VideoPlay',
        component: VideoPlay,
        meta:{
            menu:['视频管理','视频播放']
        }
    }, {
        path: '/shareinfo/shareinfolist',
        name: 'ShareInfoList',
        component: ShareInfoList,
        meta:{
            menu:['共享信息管理','共享信息列表']
        }
    }, {
        path: '/shareinfo/shareinfoaudit',
        name: 'shareinfoaudit',
        component: ShareInfoAudit,
        meta:{
            menu:['共享信息管理','共享信息审核']
        }
    }, {
        path: '/order/OrderList',
        name: 'OrderList',
        component: OrderList,
        meta:{
            menu:['订单管理','订单列表']
        }
    }, {
        path: '/financial/withdrawal',
        name: 'Withdrawal',
        component: Withdrawal,
        meta:{
            menu:['财务管理','取现记录']
        }
    }, {
        path: '/financial/withdrawalaudit',
        name: 'WithdrawalAudit',
        component: WithdrawalAudit,
        meta:{
            menu:['财务管理','提现审核']
        }
    }, {
        path: '/financial/topup',
        name: 'TopUp',
        component: TopUp,
        meta:{
            menu:['财务管理','充值记录']
        }
    }, {
        path: '/agent/partner/partner',
        name: 'Partner',
        component: Partner,
        meta:{
            menu:['代理管理','合伙人','合伙人界面总览']
        }
    }, {
        path: '/agent/partner/earnings',
        name: 'PartnerEarnings',
        component: PartnerEarnings,
        meta:{
            menu:['代理管理','合伙人','收益总览']
        }
    }, {
        path: '/agent/partner/withdrawalagent',
        name: 'PartnerWithdrawal',
        component: PartnerWithdrawal,
        meta:{
            menu:['代理管理','合伙人','提现记录']
        }
    }, {
        path: '/agent/area/area',
        name: 'Area',
        component: Area,
        meta:{
            menu:['代理管理','区域代理','区域代理总览']
        }
    }, {
        path: '/agent/area/earnings',
        name: 'AreaEarnings',
        component: AreaEarnings,
        meta:{
            menu:['代理管理','区域代理','收益总览']
        }
    }, {
        path: '/agent/area/withdrawalagent',
        name: 'AreaWithdrawal',
        component: AreaWithdrawal,
        meta:{
            menu:['代理管理','区域代理','提现记录']
        }
    }, {
        path: '/agent/area/invite',
        name: 'AreaInvite',
        component: AreaInvite,
        meta:{
            menu:['代理管理','区域代理','邀请人']
        }
    }, {
        path: '/agent/national/national',
        name: 'National',
        component: National,
        meta:{
            menu:['代理管理','全国代理','区域代理总览']
        }
    }, {
        path: '/agent/national/earnings',
        name: 'NationalEarnings',
        component: NationalEarnings,
        meta:{
            menu:['代理管理','全国代理','收益总览']
        }
    }, {
        path: '/agent/national/invite',
        name: 'NationalInvite',
        component: NationalInvite,
        meta:{
            menu:['代理管理','全国代理','推广人']
        }
    }, {
        path: '/agent/personal/earnings',
        name: 'Personal',
        component: Personal,
        meta:{
            menu:['代理管理','个人代理','个人代理总览']
        }
    }, {
        path: '/agent/personal/personal',
        name: 'PersonalEarnings',
        component: PersonalEarnings,
        meta:{
            menu:['代理管理','个人代理','收益总览']
        }
    }, {
        path: '/agent/personal/Invite',
        name: 'PersonalInvite',
        component: PersonalInvite,
        meta:{
            menu:['代理管理','个人代理','推广人']
        }
    }, {
        path: '/system/area/permissions',
        name: 'Permissions',
        component: Permissions,
        meta:{
            menu:['系统管理','区域代理','权限设置']
        }
    }, {
        path: '/vouchers/voucherslist',
        name: 'VouchersList',
        component: VouchersList,
        meta:{
            menu:['代金券管理','代金券列表']
        }
    }, {
        path: '/system/area/agentconfig',
        name: 'AreaAgentConfig',
        component: AreaAgentConfig,
        meta:{
            menu:['系统管理','区域代理','代理设置']
        }
    }, {
        path: '/system/national/agentconfig',
        name: 'NationalAgentConfig',
        component: NationalAgentConfig,
        meta:{
            menu:['系统管理','全国代理','代理设置']
        }
    }, {
        path: '/system/system/role',
        name: 'Role',
        component: Role,
        meta:{
            menu:['系统管理','系统管理','代理设置']
        }
    }, {
        path: '/system/system/adduser',
        name: 'AddUser',
        component: AddUser,
        meta:{
            menu:['系统管理','系统管理','添加成员']
        }
    }, {
        path: '/system/system/dataentry',
        name: 'DataEntry',
        component: DataEntry,
        meta:{
            menu:['系统管理','系统管理','用户录入']
        }
    },{
        path: '/system/system/personnelmanagement',
        name: 'PersonnelManagement',
        component: PersonnelManagement,
        meta:{
            menu:['系统管理','系统管理','成员管理']
        }
    }, {
        path: '/system/system/permissionlsit',
        name: 'PermissionLsit',
        component: PermissionLsit,
        meta:{
            menu:['系统管理','系统管理','权限管理']
        }
    }, {
        path: '/system/system/feedback',
        name: 'FeedBack',
        component: FeedBack,
        meta:{
            menu:['系统管理','系统管理','反馈管理']
        }
    }, {
        path: '/config/bannerconfig',
        name: 'Banner',
        component: Banner,
        meta:{
            menu:['系统设置','banner管理']
        }
    }, {
        path: '/config/areaconfig',
        name: 'AreaConfig',
        component: AreaConfig,
        meta:{
            menu:['系统设置','地区管理']
        }
    }, {
        path: '/config/accountconfig',
        name: 'AccountConfig',
        component: AccountConfig,
        meta:{
            menu:['系统设置','账户管理']
        }
    }, {
        path: '/config/platform',
        name: 'Platform',
        component: Platform,
        meta:{
            menu:['系统设置','平台管理']
        }
    }, {
        path: '/config/notice',
        name: 'Notice',
        component: Notice,
        meta:{
            menu:['系统设置','系统通知管理']
        }
    },{
        path: '/config/companyprofile',
        name: 'CompanyProfile',
        component: CompanyProfile,
        meta:{
            menu:['系统设置','公司简介']
        }
    },{
        path: '/config/apk',
        name: 'Apk',
        component: Apk,
        meta:{
            menu:['系统设置','安卓包管理']
        }
    }, {
        path: '*',
        component: Index
    }
];

export default new Router({
  routes
})
